Skip to content

Conversation

@omdxp
Copy link
Member

@omdxp omdxp commented Nov 19, 2025

  • Renamed logger variable to loggerService for consistency.
  • Updated logging calls to use the new loggerService structure.
  • Replaced winston with @omdxp/jslog for improved logging capabilities.
  • Added graceful shutdown handling for logger file streams.
  • Enhanced log messages with additional context and structured attributes.

- Renamed logger variable to loggerService for consistency.
- Updated logging calls to use the new loggerService structure.
- Replaced winston with @omdxp/jslog for improved logging capabilities.
- Added graceful shutdown handling for logger file streams.
- Enhanced log messages with additional context and structured attributes.
Copilot AI review requested due to automatic review settings November 19, 2025 11:18
@github-actions github-actions bot added the api API related changes ( api folder ) label Nov 19, 2025
Copilot finished reviewing on behalf of omdxp November 19, 2025 11:21
@omdxp omdxp requested a review from a team November 19, 2025 11:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the application's logging infrastructure by replacing the winston logging library with @omdxp/jslog. The changes rename logger references to loggerService for consistency and update all logging call patterns to use the new library's API. The new implementation includes environment-specific configurations (pretty console output for development, JSON file logging for production) and adds graceful shutdown handling for logger file streams.

  • Replaced winston with @omdxp/jslog (version 1.7.1)
  • Standardized logger variable naming to loggerService across all services
  • Enhanced logging with structured attributes using key-value pairs instead of object-based messages

Reviewed Changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
package.json Added @omdxp/jslog dependency and removed winston
package-lock.json Updated dependency lockfile with @omdxp/jslog and removed winston-related packages
api/src/logger/service.ts Completely rewrote logger service to use @omdxp/jslog with environment-specific handlers and file stream management
api/src/app/index.ts Added graceful shutdown handlers for SIGTERM/SIGINT signals to close logger file streams
api/src/app/middlewares/logger.ts Updated HTTP logging middleware to use new logger API with structured request/response attributes
api/src/search/service.ts Updated logger variable name and logging calls to use new structured format
api/src/postgres/service.ts Updated logging calls to use new loggerService.logger.info() pattern
api/src/fetch/service.ts Updated logger variable name and logging calls with structured attributes
api/src/digest/cron.ts Updated logger variable name and logging calls throughout the cron job
api/src/ai/service.ts Updated logger variable name and logging call
.gitignore Added api/logs directory to ignore list for log files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api API related changes ( api folder )

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants